/**
 * 
 */
package fr.isima.isipaint.utils;

import javax.swing.ImageIcon;

/**
 * @author daniel
 * 
 */
public final class IconsUtils {

	/** The only one instance of this class */
	private static IconsUtils instance;

	/**
	 * 
	 * @param path
	 *            The path of the icon
	 * @param description
	 *            A short description
	 * @return a icon
	 */
	public static ImageIcon loadIcon(String path, String description) {
		ImageIcon icon = new ImageIcon(path, description);
		if (icon == null) {
			System.err.println("Couldn't find file: " + path);
		}
		return icon;
	}

	/**
	 * The default constructor
	 */
	private IconsUtils() {
	}

	/**
	 * The only way to get an unique instance of this class
	 * 
	 * @return the unique instance
	 */
	private static IconsUtils getInstance() {
		if (instance == null) {
			instance = new IconsUtils();
		}

		return instance;
	}
}
